'use strict';
var Sequelize = require('sequelize');
var db = require('./db');

var User = db.define('User', {
  FID: {
    type: Sequelize.INTEGER,
    primaryKey: true,
    allowNull: false
  },
  FNumber: {
    type: Sequelize.STRING(100),
    unique: true,
    allowNull: false
  },
  FName: {
    type: Sequelize.STRING(255),
    unique: true,
    allowNull: false
  },
  FPassword: {
    type: Sequelize.STRING(100),
    allowNull: false
  },
  FType: {
    type: Sequelize.ENUM,
    values: ['系统管理员', '普通用户'],
    allowNull: false
  },
  FDisabled: {
    type: Sequelize.BOOLEAN,
    defaultValue: false,
    allowNull: false
  },
  //外键引用
  FDealerID: {
    type: Sequelize.INTEGER
    //references: {
    //  model: Dealer,
    //  key: 'FID'
    }
}, {
  tableName: 'user',
  timestamps: true

});

module.exports = User;